import request from '../request/request'
import { message as myMsg } from 'antd'
import {HttpStatusCode} from "axios";
export function post(api, config, resFun)
{
    console.log('post....');
    request.post(api, config)
        .then(response => {
            if (response.status === HttpStatusCode.Ok)
                resFun(response.data);
            else
                myMsg.error('请求失败,错误码:' + response.status);
        })
        .catch(error=> {
            myMsg.error('请求异常:' + error.message);
        });
}


